from base_page.base_page import BasePage
import allure
from selenium.webdriver.common.action_chains import ActionChains


class QueryWarehousePage(BasePage):
    my_btn = ('xpath', "(//span[contains(text(),'我的')])[1]")
    all_btn = ('xpath', '/html/body/div[1]/div[1]/header/div/nav[1]/ul/li[7]/div/div/div/div/div/div[4]/div[1]/a')

    def query_warehouse(self, whousename):
        with allure.step('移动到我的，点击全部，进入我的仓库页面'):
            actions = ActionChains(self.driver)
            el = self.find_el(self.my_btn)
            actions.move_to_element(el).perform()
            self.find_el(self.all_btn)
            self.do_click(self.all_btn)
